<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');

/**
 * 总扩展控制器
 */
class AR_Controller extends CI_Controller {
	
	public function __construct() {
		parent::__construct();
        date_default_timezone_set('PRC');//强制时区为PRC
	}
}

class Admin_Controller extends AR_Controller {


	public function __construct() {
		parent::__construct();
		if(!$_SESSION['member']){
			header('Location: /front/login');
			exit;
		}
		if($_SESSION['member']  && !$_SESSION['member']['id']){
				header('Location: /front/login');
				exit;
		}
		return;
	}
	
	
}

class Boss_Controller extends AR_Controller {


	public function __construct() {
		parent::__construct();
		if(!isset($_SESSION['manager']) ||!$_SESSION['manager']){
			if($_SERVER['REQUEST_URI']!="/boss/login" && $_SERVER['REQUEST_URI']!="/boss/login_post"){
				header('Location: /boss/login');
				exit;
			}
		}
		if(isset($_SESSION['manager']) && $_SESSION['manager']  && !$_SESSION['manager']['id']){
			if($_SERVER['REQUEST_URI']!="/boss/login"  && $_SERVER['REQUEST_URI']!="/boss/login_post"){
				header('Location: /boss/login');
				exit;
			}
		}
	}
}


